module.exports = function($scope, $modalInstance, $resource, obj){
	console.log(obj);
	$scope.obj = obj;

	$scope.cancel = function(){

		$modalInstance.close();

	}

	$scope.gogo = function(){

		$resource('/api/as/wc/product/update', {}, {}).save($scope.obj, function (res) {
			console.log(res);

			if (res.errcode !== 0) {
				alert(res.errmsg);
				return;
			}
			alert("保存成功");
			$modalInstance.close();

		});

	}



};